unit FmSelDate;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, fmNormal, StdCtrls, Mask, DBCtrlsEh, Buttons;

type
  TFrmSelDate = class(TfrmNormal)
    Btn_OK: TButton;
    DB_Date: TDBDateTimeEditEh;
    Label1: TLabel;
    BitBtn1: TBitBtn;
    cbPriority: TDBCheckBoxEh;
  private
    { Private declarations }
  public
    { Public declarations }
  end;
  function CreateSelDate(aCaption:string=''; CurrDate: string=''):TDatetime;
var
  FrmSelDate: TFrmSelDate;

implementation

{$R *.dfm}

function CreateSelDate(aCaption:string; CurrDate: string):TDatetime;
begin
  try
    FrmSelDate := TFrmSelDate.Create(application);
    if aCaption<>'' then
    begin
      FrmSelDate.Caption := aCaption;
    end;
    if CurrDate<>'' then
      frmSelDate.DB_Date.Value := CurrDate
    else frmSelDate.DB_Date.Value := Date;
    if FrmSelDate.ShowModal = mrOK then
      result := FrmSelDate.DB_Date.Value
    else Result := 0;
  finally
    FrmSelDate := nil;
  end;
end;

end.
